#include <iostream>

using namespace std;

class Complex
{
public:
    Complex(double &Rel, double &Img);
    void SetReal(double &Rel);
    double GetReal();
    void SetImg(double &Img);
    double GetImg();
    Complex operator+(const Complex &b);
    friend ostream &operator<<(ostream &out, Complex &a);

private:
    double m_Rel;
    double m_Img;
};

Complex::Complex(double &Real, double &Img)
{
    this->m_Img = Img;
    this->m_Rel = Real;
}

void Complex::SetImg(double &Img)
{
    this->m_Img = Img;
}

void Complex::SetReal(double &Real)
{
    this->m_Rel = Real;
}

double Complex::GetImg()
{
    return this->m_Img;
}

double Complex::GetReal()
{
    return this->m_Rel;
}

Complex Complex::operator+(const Complex &b)
{
    this->m_Rel += b.m_Rel;
    this->m_Img += b.m_Img;
}

ostream &operator<<(ostream &out, Complex &a)
{
    out << a.m_Rel << "+" << a.m_Img << "j";
}

int main(int argc, char const *argv[])
{
    /* code */
    double a = 8.0, b = 3.0;
    Complex *complex = new Complex(a, b);
    cout << *complex << endl;
    return 0;
}
